﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using System.Xml;

public partial class TestPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Our getVars, to test the get of our php. 
        //We can get a page without any of these vars too though.
        string getVars = "?a=getAllEmployees&apiKey=f3235ebf-c401-450a-8e16-1fab38ff8ef0&accessKey=YoMXCZHzVVVT-GUPxlzArRrzjKj-bacbfefb-63a7-4527-a4b1-fed7e6c82c23";
        //Initialization, we use localhost, change if applicable
        HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://www.apptivo.com/app/dao/employee{0}", getVars));
        //This time, our method is GET.
        WebReq.Method = "GET";
        //WebReq.ContentType = "text/xml; encoding='utf-8'";
        //From here on, it's all the same as above.
        HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
        //Let's show some information about the response
        //Now load the XML Document
        string result = null;
        StreamReader reader =
        new StreamReader(WebResp.GetResponseStream());
        result = reader.ReadToEnd();

    }
}